using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class logged_Default : System.Web.UI.Page
{

    private ActivUFRJ.Classes.Usuario.Usuario usuario = ActivUFRJ.Utilitarios.Usuario.GetSessao();

    protected void Page_Load(object sender, EventArgs e)
    {

        /****************************************************/
        // valida a sessao do usuario
        ActivUFRJ.Utilitarios.Usuario.ValidarSessao(usuario);
        /****************************************************/


        lblUltimasNoticias.Text = "";
        CarregarListaNoticiasSistema();
        CarregarEstatisticas();
    }

    private void CarregarEstatisticas()
    {
        lblNumeroArtefatos.Text = ActivUFRJ.Sistema.Sistema.GetNumeroArtefatosDisponiveis().ToString();
        lblNumeroComunidades.Text = ActivUFRJ.Sistema.Sistema.GetNumeroComunidadesDisponiveis().ToString();
        lblNumeroUsuarios.Text = ActivUFRJ.Sistema.Sistema.GetNumeroUsuariosCadastrados().ToString();
    }

    private void CarregarListaNoticiasSistema()
    {
        ActivUFRJ.Sistema.Aviso[] unList = ActivUFRJ.Sistema.Aviso.GetListaAvisos();
        foreach (ActivUFRJ.Sistema.Aviso un in unList)
        {
            lblUltimasNoticias.Text += "<UL><LI>[" + un.DataRegistro.ToShortDateString() + "] " + un.Nome + " - " + un.Descricao + "</LI></UL>\n\n";
        }
    }
    protected void lbEstatisticas01_Click(object sender, EventArgs e)
    {
        MultiView1.ActiveViewIndex = 1;
    }
    protected void lbVersoes01_Click(object sender, EventArgs e)
    {
        MultiView1.ActiveViewIndex = 2;
    }
    protected void lbUltimasNoticias02_Click(object sender, EventArgs e)
    {
        MultiView1.ActiveViewIndex = 0;
    }
    protected void lbEstatisticas02_Click(object sender, EventArgs e)
    {

    }
    protected void lbVersoes02_Click(object sender, EventArgs e)
    {
        MultiView1.ActiveViewIndex = 2;
    }
    protected void lbUltimasNoticias03_Click(object sender, EventArgs e)
    {
        MultiView1.ActiveViewIndex = 0;
    }
    protected void lbEstatisticas03_Click(object sender, EventArgs e)
    {
        MultiView1.ActiveViewIndex = 1;
    }
    protected void lbRecomendacoes01_Click(object sender, EventArgs e)
    {
        MultiView1.ActiveViewIndex = 3;
    }
    protected void lbRecomendacoes02_Click(object sender, EventArgs e)
    {
        MultiView1.ActiveViewIndex = 3;
    }
    protected void lbRecomendacoes03_Click(object sender, EventArgs e)
    {
        MultiView1.ActiveViewIndex = 3;
    }
    protected void lbVersoes04_Click(object sender, EventArgs e)
    {
        MultiView1.ActiveViewIndex = 2;
    }
}
